<!DOCTYPE html>
<html>
<head>
    <title>编辑记录 - {{.id}}</title>
    <link href="/static/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" href="/static/css/bootstrap-icons.css">
    <link rel="stylesheet" href="/static/css/style.css">
    <link rel="shortcut icon" href="/static/images/favicon.ico">
    <script src="/static/js/wangEditor.min.js"></script>
</head>
<body>
    <div class="container">
        <div class="tag-id-box d-flex justify-content-between align-items-center">
            <div>
                <h4 class="mb-0">私有标签ID: <span id="tagId">{{.id}}</span></h4>
                <small class="text-muted">正在编辑记录 #{{.record.ID}}</small>
            </div>
            <a href="/?id={{.id}}" class="btn btn-sm btn-outline-secondary">
                <i class="bi bi-arrow-left"></i> 返回列表
            </a>
        </div>

        <div class="d-flex justify-content-between align-items-center mb-4">
            <h1 class="mb-0">编辑记录</h1>
        </div>
        
        <div class="card">
            <div class="card-body">
                <form id="editForm">
                    <input type="hidden" id="record_id" value="{{.record.ID}}">
                    <input type="hidden" id="tag_id" value="{{.id}}">
                    
                    <div class="mb-4">
                        <label for="item_id" class="form-label fw-semibold">项目ID</label>
                        <input type="text" class="form-control form-control-lg" id="item_id" 
                               value="{{.record.ItemID}}" required>
                    </div>
                    
                    <div class="mb-4">
                        <label class="form-label fw-semibold">标签内容</label>
                        <div id="editor-container" class="editor-container"></div>
                        <input type="hidden" id="label" name="label" value="{{.record.Label}}">
                    </div>
                    
                    <div class="d-flex justify-content-end gap-3 pt-3">
                        <a href="/?id={{.id}}" class="btn btn-outline-secondary btn-action">
                            <i class="bi bi-x-lg"></i> 取消
                        </a>
                        <button type="submit" class="btn btn-primary btn-action">
                            <i class="bi bi-save"></i> 保存更改
                        </button>
                    </div>
                </form>
            </div>
        </div>
    </div>

    <script src="/static/js/bootstrap.bundle.min.js"></script>
    <script src="/static/js/utils.js"></script>
    <script src="/static/js/edit.js"></script>
    {{ template "footer.html" . }}
</body>
</html>